<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>div输入焦点</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }

        .toolbar {
            height: 50px;
            background-color: skyblue;
        }

        .canvas {
            height: 2000px;
            background-color: lightgray;
        }
    </style>
    <script src="jquery-3.6.0.js"></script>
</head>
<body>

<div class="toolbar"></div>
<div class="canvas">
    <!--添加了tabindex的属性之后，可以使元素进入focus状态，可以支持键盘事件-->
    <svg id="svg-canvas" tabindex="0" height="1000px" width="1000px">
    </svg>
</div>

<script src="div-key-event.js"></script>
</body>
</html>